<template>
  <router-view></router-view>
  <RightBar v-if="showRightBar"/>
</template>
<script setup>
import {ref, watch} from "vue";
import {useRoute, useRouter} from 'vue-router';
import {Constant} from "@/api/const.js";
import {useStore} from 'vuex';

const store = useStore();
store.dispatch('getCustomerImg', 'someValue');
const route = useRoute();
const router = useRouter();
let showRightBar = ref(false)
watch(() =>
        router.currentRoute.value.path,
    (toPath) => {
      let index = Constant.rightBarBlactlist.findIndex((item) => item == toPath)
      if (index > -1) {
        showRightBar.value = false
      } else {
        showRightBar.value = true
      }
    }, {immediate: true, deep: true})
</script>

<style>
body {
  width: calc(100%) !important;
}

</style>
